define(['vue','common','echarts'],function (Vue,common,echarts){
    const Controller = {
        index:function (){
            let {createApp} = Vue;
            let app = createApp({
                data(){
                    return {
                        plugin:10,
                        users:100,
                        addusers:10,
                        addusers7:15,
                        addusers30:50,
                        myChart:null,
                        systemData:[
                            {
                                name:"Workerman版本",
                                value:"3.3.6"
                            },
                            {
                                name:"Webman版本",
                                value:"2.1.2"
                            },
                            {
                                name:"PHP版本",
                                value:"8.2.9"
                            },
                            {
                                name:"MySQL版本",
                                value:"8.0.31"
                            },
                            {
                                name:"操作系统",
                                value:"Linux"
                            }
                        ]
                    }
                },
                created(){
                    this.systemData = Config.sysdata
                    console.log(this.systemData)
                },
                mounted(){
                    var myChart = echarts.init(document.getElementById('main'));
                    var option = {
                        title: {
                            text: 'ECharts 示例'
                        },
                        tooltip: {},
                        legend: {
                            data:['销量']
                        },
                        xAxis: {
                            data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
                        },
                        yAxis: {},
                        series: [{
                            name: '销量',
                            type: 'bar',
                            data: [5, 20, 36, 10, 10, 20]
                        }]
                    };
                    // 使用刚指定的配置项和数据显示图表。
                    myChart.setOption(option);
                    this.myChart = myChart
                    let that = this
                    setTimeout(()=>{
                        that.test()
                    },5000)
                },
                methods:{
                    test(){
                        console.log('开始执行')
                        var option = {
                            title: {
                                text: 'ECharts 示例'
                            },
                            tooltip: {},
                            legend: {
                                data:['销量']
                            },
                            xAxis: {
                                data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
                            },
                            yAxis: {},
                            series: [{
                                name: '销量',
                                type: 'bar',
                                data: [125, 20, 36, 10, 10, 20]
                            }]
                        };
                        this.myChart.setOption(option);
                        console.log('开始结束')
                    }
                }
            })
            common.load(app,['icon'])
            app.mount('#app')
        }
    }
    return Controller;
})